//个人成绩与年级均分
var className = []
var scoreData = []
var aveData = []
var option_grade1 = {
    grid: {
        left: '0',
        top: '50',
        right: '0',
        bottom: '10',
        containLabel: true
    },
    legend: {
        top: 0,
        textStyle: {

            color: "#fff",
        },
        itemWidth: 10,  // 设置宽度
        itemHeight: 10, // 设置高度
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: { // 坐标轴指示器，坐标轴触发有效
            type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    xAxis: {
        type: 'category',
        data: className,
        axisTick: { //---坐标轴 刻度
            show: true, //---是否显示
        },
        axisLine: { //---坐标轴 轴线
            show: true, //---是否显示
            lineStyle: {
                color: 'rgba(255,255,255,.1)',
                width: 1,
            },
        },
        axisLabel: {//X轴文字
            textStyle: {
                fontSize: 12,
                color: '#fff'
            },
        },
    },
    yAxis: {
        type: 'value',
        splitLine: {//分割线
            show: true,
            lineStyle: {
                color: 'rgba(255,255,255,.1)',
                width: 1,
                type: 'dotted'
            }
        },
        axisLabel: {//Y轴刻度值
            formatter: '{value}',
            textStyle: {
                fontSize: 12,
                color: '#fff'
            },
        },
        axisLine: { //---坐标轴 轴线
            show: false, //---是否显示
        },
    },
    series: [{
        name: '课程成绩',
        type: 'bar',
        data: scoreData,
        barWidth: 15,
        barGap: 1, //柱子之间间距 //柱图宽度      两种情况都要设置，设置series 中对应数据柱形的itemStyle属性下的emphasis和normal的barBorderRadius属性初始化时候圆角  鼠标移上去圆角
        itemStyle: {
            normal: {
                barBorderRadius: 50,
                color: "#446ACF",
            }
        },
    }, {
        name: '年级均分',
        type: 'bar',
        data: aveData,
        barWidth: 15, //柱图宽度
        itemStyle: {
            normal: { //设置颜色的渐变
                barBorderRadius: 50,
                color: "#4fb69d",

            }
        }
    }]
};

//六大指标
var radarData = []
var radarKey = []

var showData =[]

var sradarData = []
var sshowData =[]
var option_pradar = {
    tooltip: {
        trigger: 'axis'
    },
    color:['#0952ee','#ea8864'],
    legend: {
        show:true,
        data:[
            {
                name:'身心指标平均值',
                textStyle:{
                    color:'#0952ee',
                },
            },
            {
                name: '该学生身心指标',
                textStyle:{
                    color: '#ea8864',
                },

            }
        ],
        right:0,
        orient:'vertical',
        icon:'circle',
        itemWidth: 40,
        itemHeight: 13,
        itemGap: 10,//间距
        formatter:['{name}'].join('\n'),//实现图例与文字对齐
        textStyle:{
            fontSize:14
        },

    },
    radar: [{
        indicator: [{
            name: '学业表现',
            max: 5,
        }, {
            name: '社团活跃度',
            max: 5,
        }, {
            name: '身体素质',
            max: 5,
        }, {
            name: '人际关系指数',
            max: 5,
        }, {
            name: '阅读',
            max: 5,
        }, {
            name: '睡眠质量',
            max: 5,
        }],
        center: ['50%', '50%'],
        radius: '80%',
        startAngle: 90,
        splitNumber: 4,
        shape: 'circle',
        name: {
            padding:-5,
            formatter: '{value}',
            textStyle: {
                fontSize: 18, //外圈标签字体大小
                color: 'white' //外圈标签字体颜色
            }
        },
        splitArea: {
            show: true,
            areaStyle: {
                color: 'rgba(255,255,255,.05)'
            }
        },
        axisLabel: {
            show: false,
            fontSize: 20,
            color: "#000",
            fontStyle: "normal",
            fontWeight: "normal"
        },
        axisLine: {
            show: true,
            lineStyle: {
                color: 'rgba(255,255,255,0.5)'
            }
        },
        splitLine: {
            show: true,
            lineStyle: {
                color: 'rgba(255,255,255,0.5)'
            }
        }
    }, ],
    series: [{
        type: 'radar',
        name: '身心指标平均值',
        tooltip: {
            trigger: 'item'
        },
        itemStyle: {
            emphasis: {
                lineStyle: {
                    width: 4
                }
            }
        },
        data: [{
                name: '身心指标平均值',
                value: showData,
                lineStyle: {
                    normal: {
                        color:'#0952ee',
                        width:2,
                    }
                },
                areaStyle: {
                    normal: {
                        color: '#0952ee',
                        opacity:.3
                    }
                },
            }]
    },
        {
            type: 'radar',
            name: '该学生身心指标',
            tooltip: {
                trigger: 'item'
            },
            itemStyle: {
                emphasis: {
                    lineStyle: {
                        width: 4
                    }
                }
            },
            data: [{
                name: '该学生身心指标',
                value: sshowData,
                symbol: 'circle',
                symbolSize: 12,
                label: {                    // 单个拐点文本的样式设置
                    normal: {
                        show: true,             // 单个拐点文本的样式设置。[ default: false ]
                        position: 'top',        // 标签的位置。[ default: top ]
                        distance: 5,            // 距离图形元素的距离。当 position 为字符描述值（如 'top'、'insideRight'）时候有效。[ default: 5 ]
                        color: '#ea8864',          // 文字的颜色。如果设置为 'auto'，则为视觉映射得到的颜色，如系列色。[ default: "#fff" ]
                        fontSize: 16,           // 文字的字体大小
                        formatter:function(params) {
                            return params.value;
                        }
                    }
                },
                lineStyle: {
                    normal: {
                        color:'#ea8864',
                        width:2,
                    }
                },
                areaStyle: {
                    normal: {
                        color: '#ea8864',
                        opacity:.5
                    }
                },
                itemStyle: {
                    color:'#ffffff'
                },
            }]
        },
    ]
};
//上学期成绩变化趋势
var option_ptrend = {
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            lineStyle: {
                color: '#dddc6b'
            }
        }
    },
    grid: {
        left: '10',
        top: '50',
        right: '30',
        bottom: '20',
        containLabel: true
    },
    xAxis: [{
        type: 'category',

        boundaryGap: false,
        axisLabel:  {
            textStyle: {
                color: "rgba(255,255,255,.6)",
                fontSize:14,
            },
            interval:0
        },
        axisLine: {
            lineStyle: {
                color: 'rgb(255,255,255)'
            }
        },
        data: className
    }, {
        axisPointer: {show: false},
        axisLine: {  show: false},
        position: 'bottom',
        offset: 20,
    }],
    yAxis: [{
        type: 'value',
        axisTick: {show: false},
        splitNumber: 4,
        axisLine: {
            lineStyle: {
                color: 'rgb(255,255,255)'
            }
        },
        axisLabel:  {
            textStyle: {
                color: "rgb(255,255,255)",
                fontSize:16,
            },
        },

        splitLine: {
            lineStyle: {
                color: 'rgb(255,255,255)',
                type: 'dotted',
            }
        }
    }],
    series: [
        {
            type: 'line',
            smooth: true,
            symbol: 'circle',
            symbolSize: 5,
            showSymbol: false,
            lineStyle: {

                normal: {
                    color: 'rgba(31, 174, 234, 1)',
                    width: 2
                }
            },
            areaStyle: {
                normal: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: 'rgba(31,174,234,0.59)'
                    }, {
                        offset: 0.8,
                        color: 'rgba(31,174,234,0.22)'
                    }], false),
                    shadowColor: 'rgba(0,0,0,0.15)',
                }
            },
            itemStyle: {
                normal: {
                    color: '#1f7eea',
                    borderColor: 'rgba(31, 174, 234, .1)',
                    borderWidth: 5
                }
            },
            data: scoreData
        },

    ]

};